UAEndpointDescriptor endpointDescriptor =
"opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
// or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
// or "https://opcua.demo-this.com:51212/UA/SampleServer/"
var mapper = new UAClientMapper();
var target = new MyClass2();
// Define a type-less mapping.
MemberInfo memberInfo = target.GetType().GetMember("Value").SingleOrDefault();
Debug.Assert(memberInfo != null);
mapper.DefineMapping(
new UAClientDataMappingSource(
endpointDescriptor,
"nsu=http://test.org/UA/Data/ ;i=10389",
UAAttributeId.Value,
UAIndexRangeList.Empty,
UAReadParameters.CacheMaximumAge),
new UAClientDataMapping(typeof(Int32)),
new ObjectMemberLinkingTarget(target.GetType(), target, memberInfo));
// Perform a read operation.
mapper.Read();